package com.atlansheng.rocketmqdemoboot.demos.controller;

import com.atlansheng.rocketmqdemoboot.demos.producer.ProducerSend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: MsgController
 * @Description:
 * @Date 2024/03/04 11:51
 * @Author songshaoqiu
 **/
@RestController
public class MsgController {

    @Autowired
    ProducerSend producerSend;

    @GetMapping("/send")
    public String send(@RequestParam("id")Long id,@RequestParam("name") String name){
        producerSend.sendAsync(id,name);
        return "success";
    }

        @GetMapping("/trans")
    public String trans(@RequestParam("id") Long id){
        producerSend.trans(id);

        return "success";
    }
}
